<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%@ include file="../../common/jsp/sheetHeader.jsp" %>
<script>
	$(document).ready(function() {
		//sheet 초기화  
		createIBSheet2(document.getElementById("viewArea"),"mySheet","100%","400px");
		
		var cfg = {SearchMode:smLazyLoad, Page:10, MergeSheet:msNone};
		var headers = [
			{Text:"신청인|신청일자|결재여부|신청금액|근태기간|근태기간|시간|시간", Align:"Center"}
			,{Text:"신청인|신청일자|결재여부|신청금액|시작일|종료일|시작|종료", Align:"Center"}
		];
		var info = {Sort:1,ColMove:1,ColResize:1,HeaderCheck:0};
		var cols = [
			{Type:"Text",Width:80,ColMerge:1},
			{Type:"Date",Width:100,Format:"Ymd",ColMerge:1,Align:"Center"},
			{Type:"CheckBox",Width:80,SaveName:"A",ColMerge:0},
			{Type:"AutoSum",Width:85,SaveName:"B",Format:"Integer",ColMerge:0},
			{Type:"Date",Width:100,SaveName:"C",Format:"Ymd",Align:"Center",ColMerge:0},
			{Type:"Date",Width:100,SaveName:"D",Format:"Ymd",Align:"Center",ColMerge:0},
			{Type:"Date",Width:100,Format:"Hm",Align:"Center"},
			{Type:"Date",Width:100,Format:"Hm",Align:"Center"}
		];

		mySheet.SetConfig(cfg);
		mySheet.InitHeaders(headers,info);
		mySheet.InitColumns(cols);
		
		mySheet.FitColWidth();
		
		doAction('search');
	});
	
	/*Sheet 각종 처리*/
	function doAction(sAction) {
		switch(sAction) {
			case "search":		//조회
				mySheet.DoSearch("../data/merge_data.xml");
				break;
			case "reload":
				mySheet.RemoveAll();
				break;
		}
	}

	function setMerge(str){
		mySheet.SetMergeSheet(eval(str));
		doAction('search');
	}
</script>
<title>머지 영역 예제</title>
</head>
<body>
<div id="main">
	<%@ include file="../../common/jsp/sheetNavi.jsp" %>	
	<div id="title">머지 없음 예제</div>
	<div id="desc">
		헤더와 데이터 행에 세로로 같은 데이터가 있더라도 머지를 하지 않는다.<br>
		MergeSheet 를 설정 하지 않으면 default로 동작한다.
		
		<br>
	</div>

	<div id="functionArea">
		<span>
			<input type="button" value="전체머지없음" onclick="setMerge('msNone')">
			<input type="button" value="헤더만머지" onclick="setMerge('msHeaderOnly')">
			<input type="button" value="전체머지가능" onclick="setMerge('msAll')">
			<input type="button" value="앞컬럼기준머지" onclick="setMerge('msHeaderOnly + msPrevColumnMerge')">
			<input type="button" value="기준컬럼머지" onclick="setMerge('msBaseColumnMerge +msHeaderOnly')">
		</span>
	</div>
	
	<div id="viewArea">
	</div>
</div>
</body>
</html>